]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Fix setting ImageMenuItem's icons via strings
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Oct 2017 22:09:52 +0000 (00:09 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 16 Oct 2017 18:47:05 +0000 (20:47 +0200)
Commit 28ca96064bcb added support for setting PopupImageMenuItem's icons
via GIcons as well as via strings. However as the check whether an object
implements the GIcon interface only works on GObjects, specifying an icon
name was broken. Fix that to actually allow both strings and GIcons.

https://bugzilla.gnome.org/show_bug.cgi?id=789018

js/ui/popupMenu.js

index d00132ff978575708a8f199c6d304512a19accbb..cb975f5f5c47eb07f9826fdc8e78c4fac9e31025 100644 (file)
@@ -405,7 +405,7 @@ var PopupImageMenuItem = new Lang.Class({
 
     setIcon: function(icon) {
         // The 'icon' parameter can be either a Gio.Icon or a string.
-        if (GObject.type_is_a(icon, Gio.Icon))
+        if (icon instanceof GObject.Object && GObject.type_is_a(icon, Gio.Icon))
             this._icon.gicon = icon;
         else
             this._icon.icon_name = icon;